# -*- coding:utf-8 -*-
# __author__ : "张百科"
# Date: 2021/1/26 10:50
# File: order.py
# IDE: PyCharm
from django.db import models
from utils.common import prefix
from utils.choices import order_offline,order_pay_status,order_status

class Order(models.Model):
    id = models.AutoField(db_column='ID', primary_key=True)  # Field name made lowercase.
    mobile = models.CharField(max_length=20)
    link_man = models.CharField(max_length=20)
    order_sn = models.CharField(max_length=50)
    create_time = models.DateTimeField()
    order_status = models.CharField(max_length=10,choices=order_status)
    remark = models.CharField(max_length=200, blank=True, null=True)
    update_time = models.DateTimeField()
    offline_pay = models.IntegerField(blank=True, null=True,choices=order_offline)
    total = models.DecimalField(max_digits=10, decimal_places=2)
    deal = models.DecimalField(max_digits=10, decimal_places=2)
    pay_status = models.IntegerField(blank=True, null=True,choices=order_pay_status)
    wx_user_id = models.IntegerField()
    address_id = models.IntegerField()

    class Meta:
        managed = False
        db_table = prefix+'order'